package com.seu.spring.advance.aop;

/**
 * 代理工厂
 *
 * @author liangfeihu
 * @since 2018/12/28 17:57
 */
public class ProxyFactory extends AdvisedSupport implements AopProxy {

    /**
     * 获取代理对象
     */
    @Override
    public Object getProxy() {
        return createAopProxy().getProxy();
    }

    /**
     * 动态代理：通过JDK或Cglib代理提供代理对象
     */
    private AopProxy createAopProxy() {
        return new JdkDynamicAopProxy(this);
    }

}
